<template>
  <div>
    <mt-header title="我的二维码" fixed>
      <router-link to="/" slot="left">
        <mt-button icon="back">返回</mt-button>
      </router-link>
    </mt-header>
    <div class="code">
      <div class="img">
        <img :src="img" alt="" width="100%">
      </div>
      <div class="bottom">
        <p>扫描二维码获取优惠商品</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'qr-code',
  data () {
    return {
      url: {
        code: '/distributor/qrcode/create'
      },
      img: ''
    }
  },
  methods: {},
  created () {
    this.$ajax.post(this.url.code).then(res => {
      if (res.data.success) {
        this.img = res.data.data
      }
    })
  }
}
</script>

<style scoped>
  .code{
    margin-top: 50px;
  }
  .code .img{
    width: 150px;
    height: 150px;
    margin: 0 auto;
  }
  .code .bottom{
    font-size: 12px;
    color: #80848f;
    text-align: center;
    margin-top: 16px;
  }
</style>
